package com.example.demo.service;

import com.example.demo.dataobject.BloodSugar;
import com.example.demo.dataobject.BloodSugarRecord;

import java.sql.Date;
import java.sql.Timestamp;
import java.util.List;

public interface BloodSugarRecordService {
    BloodSugarRecord save(Double bloodSugar, String telephone, Integer periodType,  Date date,Timestamp recordTime, String remarks);
    List<BloodSugarRecord> findByTelephone(String telephone);
    BloodSugarRecord findById(Integer id);
    Boolean delete(Integer id);
    BloodSugarRecord saveModification(Integer id,Double bloodSugar, String telephone, Integer periodType,  Date date,Timestamp recordTime, String remarks);

    List<BloodSugarRecord> findByDateOrderByRecordTime(Date date);

    List<BloodSugarRecord> findByTelephoneAndDateOrderByRecordTime(String telephone,Date date);

    BloodSugarRecord findLastSugarRecord(String telephone);

    List<BloodSugarRecord> findByUserIdAndDateInAWeek(String telephone,Date date);
    List<BloodSugarRecord> findByUserIdAndDateInAMonth(String telephone,Date date);
    List<BloodSugarRecord> findByUserIdAndDateInThreeMonth(String telephone,Date date);
    List<BloodSugarRecord> findByUserIdAndDateInAPeriod(String telephone,Date date);


}
